View Javadoc
1   package edu.jiangxin.apktoolbox.help.settings;
2   
3   import edu.jiangxin.apktoolbox.swing.extend.EasyChildTabbedPanel;
4   import edu.jiangxin.apktoolbox.swing.extend.EasyPanel;
5   
6   import javax.swing.*;
7   
8   public class SettingsPanel extends EasyPanel {
9       private static final long serialVersionUID = 63924900336217723L;
10  
11      @Override
12      public void initUI() {
13          BoxLayout boxLayout = new BoxLayout(this, BoxLayout.Y_AXIS);
14          setLayout(boxLayout);
15  
16          JTabbedPane tabbedPane = new JTabbedPane();
17  
18          EasyChildTabbedPanel lookAndFeelPanel = new LookAndFeelPanel();
19          String lookAndFeelTitle = bundle.getString("help.settings.look.and.feel.title");
20          tabbedPane.addTab(lookAndFeelTitle, null, lookAndFeelPanel, lookAndFeelTitle);
21  
22          EasyChildTabbedPanel localePanel = new LocalePanel();
23          String localeTitle = bundle.getString("help.settings.locale.title");
24          tabbedPane.addTab(localeTitle, null, localePanel, localeTitle);
25  
26          EasyChildTabbedPanel alwaysOnTopPanel = new AlwaysOnTopPanel();
27          String alwaysOnTopTitle = bundle.getString("help.settings.always.on.top.title");
28          tabbedPane.addTab(alwaysOnTopTitle, null, alwaysOnTopPanel, alwaysOnTopTitle);
29  
30          EasyChildTabbedPanel dependencyPathPanel = new DependencyPathPanel();
31          String dependencyPathTitle = bundle.getString("help.settings.dependency.path");
32          tabbedPane.addTab(dependencyPathTitle, null, dependencyPathPanel, dependencyPathTitle);
33  
34          EasyChildTabbedPanel addToStartupPanel = new AddToStartupPanel();
35          String addToStartupTitle = bundle.getString("help.settings.add.to.startup");
36          tabbedPane.addTab(addToStartupTitle, null, addToStartupPanel, addToStartupTitle);
37  
38          tabbedPane.addChangeListener(e -> {
39              EasyChildTabbedPanel selectedPanel = (EasyChildTabbedPanel) tabbedPane.getSelectedComponent();
40              selectedPanel.onTabSelected();
41          });
42  
43          tabbedPane.setSelectedComponent(dependencyPathPanel);
44          dependencyPathPanel.onTabSelected();
45  
46          add(tabbedPane);
47          add(Box.createVerticalGlue());
48      }
49  
50  }
51